package cn.javabb.project.service;

import cn.javabb.project.entity.SysTemplate;
import cn.javabb.project.entity.SysTemplateGroup;
import cn.javabb.project.mapper.TemplateGroupMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collector;
import java.util.stream.Collectors;

/**
 * @desc:
 * @author: javabb (javabob(a)163.com)
 * @create: 2021/05/05 14:54
 */
@Service
public class TemplateGroupService extends ServiceImpl<TemplateGroupMapper, SysTemplateGroup> {

    @Autowired
    private TemplateService templateService;

    public boolean deleteById(Long id) {
        try {
            if (this.removeById(id)) {
                //删除模版
                templateService.deleteByGroupId(id);
            }
        } catch (Exception e) {
            return false;
        }
        return true;
    }


}
